<!--
 * @Author: your name
 * @Date: 2022-04-08 17:31:43
 * @LastEditTime: 2022-04-08 17:35:55
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \geyao\面试题this指向220408.html
-->
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    var name = 'name';
    var A = {
      name: 'A',
      sayHello: function () {
        let s = () => console.log(this.name);
        return s;
      }
    };
    let sayHello = A.sayHello();
    sayHello();//A
    var B = {
      name: 'B'
    };
    sayHello.call(B);//A
  </script>
</body>

</html>